load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "descs",
    srcs = [
        "collection.go",
        "descriptor.go",
        "dist_sql_function_resolver.go",
        "dist_sql_type_resolver.go",
        "errors.go",
        "factory.go",
        "getters.go",
        "helpers.go",
        "hydrate.go",
        "leased_descriptors.go",
        "schema.go",
        "session_data.go",
        "synthetic_descriptors.go",
        "system_table.go",
        "table.go",
        "temporary_descriptors.go",
        "txn.go",
        "uncommitted_descriptors.go",
        "uncommitted_metadata.go",
        "validate.go",
        "virtual_descriptors.go",
        "zone_config_validator.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/catalog/hydrateddesccache",
        "//pkg/sql/catalog/internal/catkv",
        "//pkg/sql/catalog/internal/validate",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/nstree",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/catalog/zone",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/regionliveness",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/types",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/retry",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_lib_pq//oid",
    ],
)

go_test(
    name = "descs_test",
    size = "medium",
    srcs = [
        "collection_test.go",
        "errors_test.go",
        "main_test.go",
        "txn_external_test.go",
        "txn_with_executor_datadriven_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":descs"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvserver",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/nstree",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/isql",
        "//pkg/sql/parser",
        "//pkg/sql/privilege",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sqlliveness",
        "//pkg/sql/sqlliveness/sqllivenesstestutils",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_cockroach_go_v2//crdb",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_lib_pq//oid",
        "@com_github_stretchr_testify//require",
    ],
)
